﻿@page
@model IceDog.SSHConnection.LocalCommand.Pages.CommandModel
@{
    ViewData["Title"] = "Command";
}

<h1>Command</h1>

<div>
    <h2>link to ssh</h2>
    <form method="post">
        <div class="form-group">
            <label asp-for="SSHClientInfo.IP">@Html.DisplayNameFor(model => model.SSHClientInfo.IP)</label>
            <input type="text" class="form-control" asp-for="SSHClientInfo.IP" placeholder="@Html.DisplayNameFor(model => model.SSHClientInfo.IP)">
        </div>
        <div class="form-group">
            <label asp-for="SSHClientInfo.Port">@Html.DisplayNameFor(model => model.SSHClientInfo.Port)</label>
            <input type="number" class="form-control" asp-for="SSHClientInfo.Port" placeholder="@Html.DisplayNameFor(model => model.SSHClientInfo.Port)">
        </div>
        <div class="form-group">
            <label asp-for="SSHClientInfo.UserName">@Html.DisplayNameFor(model => model.SSHClientInfo.UserName)</label>
            <input type="text" class="form-control" asp-for="SSHClientInfo.UserName" placeholder="@Html.DisplayNameFor(model => model.SSHClientInfo.UserName)">
        </div>
        <div class="form-group">
            <label asp-for="SSHClientInfo.Password">@Html.DisplayNameFor(model => model.SSHClientInfo.Password) (@Model.SSHClientInfo.Password)</label>
            <input type="password" class="form-control" asp-for="SSHClientInfo.Password" placeholder="@Html.DisplayNameFor(model => model.SSHClientInfo.Password)" value="edoc2@love00">
        </div>
        <button type="submit" class="btn btn-primary" asp-page-handler="Connecting">连接SSH</button>
    </form>
    <hr />
    <form method="post">
        <div class="form-group">
            <label asp-for="SSHClientInfo.Command">@Html.DisplayNameFor(model => model.SSHClientInfo.Command)</label>
            <input type="text" class="form-control" asp-for="SSHClientInfo.Command" placeholder="@Html.DisplayNameFor(model => model.SSHClientInfo.Command)">
        </div>
        <button type="submit" class="btn btn-primary" asp-page-handler="Execute">执行命令</button>
    </form>
    <hr />
    <div class="card">
        <div class="card-header">@Html.DisplayNameFor(model => model.SSHClientInfo.Response)</div>
        <div class="card-body">
            @Model.SSHClientInfo.Response
        </div>
    </div>
</div>